    var li1 = document.getElementById("li1");
    li1.onmouseover = function() {
        this.className = 'toggleli on';
    }
    li1.onmouseout = function() {
        this.className = 'toggleli';
    }

    var li2 = document.getElementById("li2");
    li2.onmouseover = function() {
        this.className = 'toggleli on';
    }
    li2.onmouseout = function() {
        this.className = 'toggleli';
    }
    var li3 = document.getElementById("li3");
    li3.onmouseover = function() {
        this.className = 'toggleli on';
    }
    li3.onmouseout = function() {
        this.className = 'toggleli';
    }

    var cateitemlist = document.getElementById('cateitemlist');
    var lis = cateitemlist.getElementsByTagName('li');
    for(var i = 0;i<lis.length;i++) {
        lis[i].onmouseover = function() {
            this.className = 'cateitem on';
        }
        lis[i].onmouseout = function() {
            this.className = 'cateitem';
        }
    }

    var linknav = document.getElementById('linknav');
    var lis = linknav.getElementsByTagName('li');
    var divs = linknav.getElementsByTagName('div');
    for(var i = 0;i<lis.length;i++) {
        lis[i].index = i;
        lis[i].onclick = function() {
            for(var i =0;i<divs.length;i++) {
                divs[i].style.display = "none";
            }
            console.log(this.index);
            divs[this.index].style.display = "block";
        }
    }

                var totaltime = 12*60*60-55;//单位是秒，倒计时从12小时开会
            //思路
            //1、每隔一秒就去把totaltime值减一
            //2、把totaltime拆分成小时，分，秒
            //3、填到相应的span当中
                var timer = document.getElementById("timer");
                var spans = timer.getElementsByTagName('span');


            setInterval(function() {
                totaltime--;

                var hour = Math.floor(totaltime/(60*60));
                var minute = Math.floor((totaltime - hour*60*60)/60);
                var second = totaltime%60;
                // console.log(hour,minute,second);
                //一共有6个span，小时，分，秒各分两个
                //如果某一个值是个位数，则前面补0
                spans[0].innerHTML = Math.floor(hour/10);//保存小时的十位数
                spans[1].innerHTML = Math.floor(hour%10);//保存小时的个位数
                spans[2].innerHTML = Math.floor(minute/10);//保存分的十位数
                spans[3].innerHTML = Math.floor(minute%10);//保存分的个位数
                spans[4].innerHTML = Math.floor(second/10);//保存秒的十位数
                spans[5].innerHTML = Math.floor(second%10);//保存秒的个位数
                console.log(spans);
            }, 1000);


























